home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
keychk11.zip
/
KEYCHECK.DOC
< prev
next >
Wrap
Text File
|
1993-06-29
|
5KB
|
121 lines
█ █ ███ █ █ ███ █ █ ███ ███ █ █
█ █ █ █ █ █ █ █ █ █ █ █
██ ██ █ █ ████ ██ █ ██
█ █ █ █ █ █ █ █ █ █ █
█ █ ███ █ ███ █ █ ███ ███ █ █
---------------------------------------------
| By: David Harris |
| ece_0027@bigdog.engr.arizona.edu |
| Version 1.1 |
| 6/29/93 |
---------------------------------------------
KEYCHECK is a utility that scans the keyboard and reports which special
function keys are pressed. By setting the command line switches, it is
possible for the user to detect any combination of key presses. It is
designed to work both as a stand-alone program and as a batch utility.
Inspiration: I was compelled to write this program because I was sick
of having to wait for Windows to boot just so that I could exit back to
DOS. This simple little program makes it possible to select whether or
not Windows (or any other program) will boot from your autoexec with a
simple key press.
Another way that the program can be used is to select whether or not your
autoexec.bat file gets executed. There are times when we poor folks with
only 640k need all the resources we can get. The old method of getting
maximum memory was rename autoexec.bat to something else and reboot - No
longer. I think that a few examples might make things more clear, but first:
General syntax:
keycheck -rlcasnpv
Command line options:
r - Right shift c - Ctrl
l - Left shift a - Alt
s - Scroll lock n - Num lock
p - Caps lock v - (verbose mode on)
First of all, without any arguments KEYCHECK will display a short help
screen. The program operates in two modes: verbose and non-verbose.
The non-verbose mode is best suited for batch applications. A 'v'
anywhere in the argument will cause the program to display some useful
information about the status of the special keys.
The program generates a DOS errorlevel 1 if the command line options
selected match the keyboard status at run time. Keys other than these
seven are ignored.
--------------------------------------------------------------------------------
EXAMPLE 1 - Selectively boot windows
--------------------------------------------------------------------------------
:
:
:
other autoexec.bat stuff
:
:
:
keycheck -pn Check to see if Numlock and
Caps lock are on
if errorlevel == 1 goto end If they are, skip Windows
win
:end
If your computer is like mine, it boots up with Num Lock on. So now, in
order to prevent windows from starting when you turn on the computer,
simply press the Caps lock and you will drop right to the prompt.
--------------------------------------------------------------------------------
EXAMPLE 2 - Skip autoexec.bat during start-up
--------------------------------------------------------------------------------
keycheck -cnv Check to see if the Ctrl key
if errorlevel = 1 goto end is pressed.
:
:
:
rest of autoexec junk
:
:
:
:end
echo Autoexec.bat has been averted.
In this case, holding down the Ctrl key during start-up will skip the
entire autoexec. As a result, no TSR's will be loaded and you'll get
the maximum memory available. Also, the program will provide you some
additional info because the 'v' flag was set. Note that I again checked
for Num lock.
--------------------------------------------------------------------------------
EXAMPLE 3 - Selectively booting multiple programs
--------------------------------------------------------------------------------
...Somewhere in autoexec.bat...
keycheck -cn
if errorlevel == 1 procomm Executes procomm upon Ctrl press
keycheck -an
if errorlevel == 1 wp51 Executes Wordperfect upon Alt
keycheck -rca == 1 \games\fs4 Starts flight simulator if you
hold down RightShift-Ctrl-Alt
during startup.
With some minor changes to your autoexec (or any other bat file), you
will soon be on your way. Good Luck! Please let me know what you think
of this program. This is the first time I have released a program to
the public, so I would appreciate any feedback regarding improvements
and bugs and whatever. I hope that you find it useful.